# -*- coding: utf-8 -*-


def test_func():
    print("test_func")

    pass


def demo_func():
    print("demo_func")

    pass


demo_func()

import time
import functools


def cost_time(func):
    """装饰器：统计函数执行时间"""

    def wrapper(text, path):
    # def wrapper(*args, **kwargs):
        begin_time = time.time()
        func(text, path)
        # func(args, kwargs)
        end_time = time.time()
        print("%s cost_time %s" % (func.__name__, end_time - begin_time))
        pass

    return wrapper


def functions(parameter=None):
    """"""
    def _function(function):
        @functools.wraps(function)
        def wrapper(text, path):
        # def wrapper(*args, **kwargs):
            begin_time = time.time()
            function(text, path)
            # function(args, kwargs)
            end_time = time.time()
            print("%s-%s : %s" % (parameter, function.__name__, end_time - begin_time))
        pass

        return wrapper

    return _function
